//
//  WangqiCell.m
//  SSC
//
//  Created by 红沙尘 on 17/6/11.
//  Copyright © 2017年 红沙尘. All rights reserved.
//

#import "WangqiCell.h"

@implementation WangqiCell
{
    __weak IBOutlet UILabel *qiLabel;
    __weak IBOutlet UILabel *labelA;
    __weak IBOutlet UILabel *labelB;
    __weak IBOutlet UILabel *labelC;
    __weak IBOutlet UILabel *labelD;
    __weak IBOutlet UILabel *labelE;
    
    __weak IBOutlet NSLayoutConstraint *lineA;
    
}
- (void)awakeFromNib {
    [super awakeFromNib];
    
    lineA.constant = LineHeight;
    
    labelA.layer.cornerRadius  = 16;
    labelA.layer.masksToBounds = YES;
    labelB.layer.cornerRadius  = 16;
    labelB.layer.masksToBounds = YES;
    labelC.layer.cornerRadius  = 16;
    labelC.layer.masksToBounds = YES;
    labelD.layer.cornerRadius  = 16;
    labelD.layer.masksToBounds = YES;
    labelE.layer.cornerRadius  = 16;
    labelE.layer.masksToBounds = YES;
}

- (void)loadWithDict:(NSMutableDictionary *)dict {
    labelA.hidden = YES;
    labelB.hidden = YES;
    labelC.hidden = YES;
    labelD.hidden = YES;
    labelE.hidden = YES;
    
    qiLabel.text = [NSString stringWithFormat:@"第%@期",dict[@"issue"]];
    
    NSString *wincode = [NSString safeString:dict[@"wincode"]];
    
    NSArray *array = [wincode componentsSeparatedByString:@"-"];
    
    for (int i = 0; i < array.count; i ++) {
        UILabel *label = [self.contentView viewWithTag:100 + i];
        label.hidden = NO;
        label.text = array[i];
    }
}

@end
